import { update,get } from './crud'

export function setAddr(ip,mask,gw,dns,type,cardName){
    return update("net",{ip,mask,gw,dns,type,cardName})
}

export function getAddr(){
    return new Promise((re,rej)=>{
        get("net/").then((res)=>{
            res && res.data && res.data.result ? re(res.data.result) : rej(res?.data?.error)
        })
    })
}

export default{
    setAddr,
    getAddr,
}